package com.gamesnet.ihm;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.gamesnet.widget.ActionBar;
import com.gamesnet.widget.ActionBar.IntentAction;

public class NewCommentaireActivity extends Activity implements View.OnClickListener{
	
	EditText commentaire;
	Button submit;
	private long postId;
	
	@Override
	public void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState); 
		setContentView(R.layout.commentez);

		final ActionBar actionBar = (ActionBar) findViewById(R.id.actionbarHaut);
		actionBar.setHomeAction(new IntentAction(this, new Intent(this, DashboardActivity.class), R.drawable.home));
		actionBar.setTitre(PageTitle.COMMENT);
		
		Bundle b = getIntent().getExtras();
		Log.v("compteactivity",getIntent().toString());
		postId = b.getLong("postId");


		commentaire = (EditText) findViewById(R.id.textcommentaire);
		submit = (Button) findViewById(R.id.submitCommentaire);
		submit.setOnClickListener(this);

	}

	public void onClick(View v) {
		if(v == submit){
			Intent intent = new Intent(this, PublicationActivity.class);
			intent.putExtra("postId", postId);
			startActivity(intent);


		}

	
	}

}
